package com.geoboard;

import android.location.Location;

/**
 * The Post object is shared between the server and client.  GSON 
 * is used to convert JSON into this Java Object, and vice versa.
 * @author Gordon Meyer and John Rogers  03/13
 */
public class Post {
	public String id;
	public String board;
	public String text;
	public String created_at;
	public String lat;
	public String lng;
	public String user_id;
	public String screen_name;
	
	/**
	 * Populates the instance with the devices current
	 * location.  Other values are default.
	 * @param text Text of the message to post.
	 */
	public Post(String text){
		this.text = text;
		
		Location l = PositionManager.getLocation();
		if(l != null){
			this.lat = String.valueOf(l.getLatitude());
			this.lng = String.valueOf(l.getLongitude());
		}
		id = "0";
		board = "\"";
		created_at = "";
		user_id = "0";
		screen_name = "Anon";
	}
	
}
